package net.lastcoder.ifserver.nio;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * auth: WenYF
 * date: 2016/10/8
 */
public class PacketCodecFactory implements ProtocolCodecFactory {

    // TODO 这里要使用可配置的
    PacketEncoder encoder = new PacketEncoder();
    PacketDecoder decoder = new PacketDecoder();
    @Override
    public ProtocolEncoder getEncoder(IoSession session) throws Exception {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return decoder;
    }
}
